package com.p.lib.common.exception;

/**
 * Created by Administrator on 2018/5/31 0031.
 */

public class BaseException extends Exception {

    //ERROR
    public static final int ERROR_SOCKET = 0x1;
    public static final int ERROR_SOCKET_TIMEOUT = 0x2;
    public static final int ERROR_JSONPARSE = 0x3;
    public static final int ERROR_UNKNOW = 0x4;



    //API ERROR
    public static final int ERROR_OUT_LOGIN = -19999;


    //HTTP ERROR
    public static final int ERROR_HTTP_400 = 400;
    public static final int ERROR_HTTP_404 = 404;
    public static final int ERROR_HTTP_405 = 405;
    public static final int ERROR_HTTP_500 = 500;


    private int code;
    private String message;

    public BaseException() {
    }

    public BaseException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
